<%@ include file="/html/common/init.jsp"%>
<% 
	List<ShoppingItem> itemList = (List)request.getAttribute("TOP_RECOMMENDATION");
	String pageCount = (String) request.getAttribute("RECOMMENDATION_PAGE_COUNT");
	boolean lastPage = (Boolean) request.getAttribute("RECOMMENDATION_LAST_PAGE");
%>
<portlet:renderURL var="previousURL">
	<portlet:param name="linkType" value="previous" />
	<portlet:param name="RECOMMENDATION_PAGE_COUNT" value="<%= pageCount + StringPool.BLANK %>" />
</portlet:renderURL>
<portlet:renderURL var="nextURL">
	<portlet:param name="linkType" value="next" />
	<portlet:param name="RECOMMENDATION_PAGE_COUNT" value="<%= pageCount + StringPool.BLANK %>" />
</portlet:renderURL>
<div id="recommendation_display" style="width:760px;">
	<% if(Integer.parseInt(pageCount) > 1) { %>
		<a class="previous" href="<%= previousURL %>"><liferay-ui:message key="previous"/></a>
	<% } else {%>
		<a class="previous" href="javascript:void(0);"><liferay-ui:message key="previous" /></a>
	<% } %>
	<% for(ShoppingItem item:itemList)  {%>
		<portlet:renderURL var="detailURL">
			<portlet:param name="jspPage" value="/html/item/view_item.jsp" />
			<portlet:param name="itemId" value="<%= String.valueOf(item.getItemId()) %>" />
		</portlet:renderURL>
		<span class="toplist">
			<a href="<%= detailURL %>" style="text-decoration:none;">
				<img width='75px' height='75px' src=/image/shopping/item?img_id="<%= String.valueOf(item.getMediumImageId())%>>
			</a>
		</span>
	<% } %>
	<% if(!lastPage){ %>
		<a class="next" href="<%= nextURL %>"><liferay-ui:message key="next" /></a>
	<% }  else {%>
		<a class="next" href="javascript:void(0);"><liferay-ui:message key="next" /></a>
	<% } %>
</div>
<style type="text/css">
	#recommendation_display a.previous {
	    padding-left: 5px;
	    padding-right: 20px;
	    vertical-align: top;
	}
	
	#recommendation_display a.next {
	    padding-left: 20px;
	    padding-right: 5px;
	    vertical-align: top;
	}
	
	#recommendation_display .toplist {
		padding:2px;
		padding-right:10px;
	}
</style>